﻿using System;
using System.Linq.Expressions;

namespace MoroMoro.Samples.ToDoList.Base.Domain.Specifications
{
    /// <summary>
    /// 常に真を示す仕様を表します。
    /// </summary>
    /// <typeparam name="TEntity">エンティティの型。</typeparam>
    /// <seealso cref="Specifications.Specification&lt;TEntity&gt;"/>
    [Serializable]
    internal sealed class TrueSpecification<TEntity> : Specification<TEntity>
        where TEntity : class
    {
        /// <inheritdoc/>
        protected override Expression<Func<TEntity, bool>> CreateExpression()
        {
            return (entity) => true;
        }
    }
}
